Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-8412] Delete sessions if they are more than 60 days old #1362

Merged
merged 3 commits into from
May 12, 2022

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented May 11, 2022

Goal

Prevent sessions from being retried indefinitely in the event of HTTP or connection errors, by discarding them once more than 60 days old.

Changeset

Updates BSGSessionUploader to check the file's age prior to sending, and delete those that are too old.

Removes BugsnagSessionFileStore / BugsnagFileStore so that old session files can be deleted before being read.

Testing

Adds two new scenarios to verify that recent sessions are retried, and that ancient sessions are not.

@github-actions
Copy link

github-actions bot commented May 11, 2022

Bugsnag.framework binary size decreased by 25,120 bytes from 846,128 to 821,008 🎉

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  +150% +8.53Ki    [__LINKEDIT]
   +54% +2.50Ki   +22% +2.50Ki    [__DATA]
  -5.8%     -24  -5.8%     -24    __DATA,__objc_classlist
  -2.7%     -28  -2.7%     -28    __DATA,__objc_ivar
  -2.0%     -40  -2.0%     -40    Function Start Addresses
  -1.3%     -48  -1.3%     -48    [3 Others]
  -4.6%     -58  -4.6%     -58    __TEXT,__objc_classname
  -3.0%     -64  -3.0%     -64    Rebase Info
  -1.9%     -68  -1.9%     -68    __TEXT,__unwind_info
  -2.8%     -84  -2.8%     -84    __TEXT,__objc_methtype
  -1.3%    -128  -1.3%    -128    Export Info
  -2.7%    -184  -2.7%    -184    __DATA,__objc_selrefs
  -5.8%    -240  -5.8%    -240    __DATA,__objc_data
  -2.3%    -480  -2.3%    -480    __DATA,__cfstring
  -2.3%    -569  -2.3%    -569    __TEXT,__cstring
  -2.4%    -703  -2.4%    -703    __TEXT,__objc_methname
  -2.9% -1.53Ki  -2.9% -1.53Ki    __DATA,__objc_const
  -2.2% -3.25Ki  -2.2% -3.25Ki    Symbol Table
  -1.5% -3.73Ki  -1.5% -3.73Ki    __TEXT,__text
  -2.7% -5.05Ki  -2.7% -5.05Ki    String Table
 -43.9% -10.8Ki -43.8% -10.8Ki    [__TEXT]
  -3.0% -24.5Ki  -1.9% -16.0Ki    TOTAL

Generated by 🚫 Danger

@nickdowell nickdowell changed the base branch from master to next May 12, 2022 07:04
@nickdowell nickdowell force-pushed the nickdowell/delete-ancient-sessions branch from b878937 to 3cd43b3 Compare May 12, 2022 07:10
@nickdowell nickdowell changed the title Delete sessions if they are more than 60 days old [PLAT-8412] Delete sessions if they are more than 60 days old May 12, 2022
@nickdowell nickdowell force-pushed the nickdowell/delete-ancient-sessions branch from 3cd43b3 to c2237ec Compare May 12, 2022 09:51
@nickdowell nickdowell marked this pull request as ready for review May 12, 2022 10:59
Bugsnag/Delivery/BSGSessionUploader.m Outdated Show resolved Hide resolved
Bugsnag/Delivery/BSGSessionUploader.m Outdated Show resolved Hide resolved
@nickdowell nickdowell requested a review from kstenerud May 12, 2022 12:44
@nickdowell nickdowell merged commit 887be55 into next May 12, 2022
@nickdowell nickdowell deleted the nickdowell/delete-ancient-sessions branch May 12, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants